\(\int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx\) [263]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 45 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right )-\frac {1}{2} \cot ^2(x) \sqrt {a \sec ^2(x)} \]

[Out]

1/2*arctanh((a*sec(x)^2)^(1/2)/a^(1/2))*a^(1/2)-1/2*cot(x)^2*(a*sec(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3738, 4209, 44, 65, 213} \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right )-\frac {1}{2} \cot ^2(x) \sqrt {a \sec ^2(x)} \]

[In]

Int[Cot[x]^3*Sqrt[a + a*Tan[x]^2],x]

[Out]

(Sqrt[a]*ArcTanh[Sqrt[a*Sec[x]^2]/Sqrt[a]])/2 - (Cot[x]^2*Sqrt[a*Sec[x]^2])/2

Rule 44

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n + 1
)/((b*c - a*d)*(m + 1))), x] - Dist[d*((m + n + 2)/((b*c - a*d)*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && LtQ[n, 0]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4209

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Dist[b/(2*f), Subst[In
t[(-1 + x)^((m - 1)/2)*(b*x)^(p - 1), x], x, Sec[e + f*x]^2], x] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p] &&
 IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \int \cot ^3(x) \sqrt {a \sec ^2(x)} \, dx \\ & = \frac {1}{2} a \text {Subst}\left (\int \frac {1}{(-1+x)^2 \sqrt {a x}} \, dx,x,\sec ^2(x)\right ) \\ & = -\frac {1}{2} \cot ^2(x) \sqrt {a \sec ^2(x)}-\frac {1}{4} a \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a x}} \, dx,x,\sec ^2(x)\right ) \\ & = -\frac {1}{2} \cot ^2(x) \sqrt {a \sec ^2(x)}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1+\frac {x^2}{a}} \, dx,x,\sqrt {a \sec ^2(x)}\right ) \\ & = \frac {1}{2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a \sec ^2(x)}}{\sqrt {a}}\right )-\frac {1}{2} \cot ^2(x) \sqrt {a \sec ^2(x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.91 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {\frac {a \text {arctanh}\left (\sqrt {\cos ^2(x)}\right )}{\sqrt {\cos ^2(x)}}-a \csc ^2(x)}{2 \sqrt {a \sec ^2(x)}} \]

[In]

Integrate[Cot[x]^3*Sqrt[a + a*Tan[x]^2],x]

[Out]

((a*ArcTanh[Sqrt[Cos[x]^2]])/Sqrt[Cos[x]^2] - a*Csc[x]^2)/(2*Sqrt[a*Sec[x]^2])

Maple [A] (verified)

Time = 0.33 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.60

method result size
default \(-\frac {\sqrt {a \sec \left (x \right )^{2}}\, \left (\ln \left (-\cot \left (x \right )+\csc \left (x \right )\right ) \cos \left (x \right )+\cot \left (x \right )^{2}\right )}{2}\) \(27\)
risch \(\frac {\sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}+\sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+1\right ) \cos \left (x \right )-\sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-1\right ) \cos \left (x \right )\) \(98\)

[In]

int(cot(x)^3*(a+a*tan(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*(a*sec(x)^2)^(1/2)*(ln(-cot(x)+csc(x))*cos(x)+cot(x)^2)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.29 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {\sqrt {a} \log \left (\frac {a \tan \left (x\right )^{2} + 2 \, \sqrt {a \tan \left (x\right )^{2} + a} \sqrt {a} + 2 \, a}{\tan \left (x\right )^{2}}\right ) \tan \left (x\right )^{2} - 2 \, \sqrt {a \tan \left (x\right )^{2} + a}}{4 \, \tan \left (x\right )^{2}} \]

[In]

integrate(cot(x)^3*(a+a*tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/4*(sqrt(a)*log((a*tan(x)^2 + 2*sqrt(a*tan(x)^2 + a)*sqrt(a) + 2*a)/tan(x)^2)*tan(x)^2 - 2*sqrt(a*tan(x)^2 +
a))/tan(x)^2

Sympy [F]

\[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\int \sqrt {a \left (\tan ^{2}{\left (x \right )} + 1\right )} \cot ^{3}{\left (x \right )}\, dx \]

[In]

integrate(cot(x)**3*(a+a*tan(x)**2)**(1/2),x)

[Out]

Integral(sqrt(a*(tan(x)**2 + 1))*cot(x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 303 vs. \(2 (33) = 66\).

Time = 0.40 (sec) , antiderivative size = 303, normalized size of antiderivative = 6.73 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=-\frac {{\left (4 \, {\left (\cos \left (3 \, x\right ) + \cos \left (x\right )\right )} \cos \left (4 \, x\right ) - 4 \, {\left (2 \, \cos \left (2 \, x\right ) - 1\right )} \cos \left (3 \, x\right ) - 8 \, \cos \left (2 \, x\right ) \cos \left (x\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, x\right ) - 1\right )} \cos \left (4 \, x\right ) - \cos \left (4 \, x\right )^{2} - 4 \, \cos \left (2 \, x\right )^{2} - \sin \left (4 \, x\right )^{2} + 4 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) - 4 \, \sin \left (2 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right ) - 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + {\left (2 \, {\left (2 \, \cos \left (2 \, x\right ) - 1\right )} \cos \left (4 \, x\right ) - \cos \left (4 \, x\right )^{2} - 4 \, \cos \left (2 \, x\right )^{2} - \sin \left (4 \, x\right )^{2} + 4 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) - 4 \, \sin \left (2 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right ) - 1\right )} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) + 4 \, {\left (\sin \left (3 \, x\right ) + \sin \left (x\right )\right )} \sin \left (4 \, x\right ) - 8 \, \sin \left (3 \, x\right ) \sin \left (2 \, x\right ) - 8 \, \sin \left (2 \, x\right ) \sin \left (x\right ) + 4 \, \cos \left (x\right )\right )} \sqrt {a}}{4 \, {\left (2 \, {\left (2 \, \cos \left (2 \, x\right ) - 1\right )} \cos \left (4 \, x\right ) - \cos \left (4 \, x\right )^{2} - 4 \, \cos \left (2 \, x\right )^{2} - \sin \left (4 \, x\right )^{2} + 4 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) - 4 \, \sin \left (2 \, x\right )^{2} + 4 \, \cos \left (2 \, x\right ) - 1\right )}} \]

[In]

integrate(cot(x)^3*(a+a*tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/4*(4*(cos(3*x) + cos(x))*cos(4*x) - 4*(2*cos(2*x) - 1)*cos(3*x) - 8*cos(2*x)*cos(x) - (2*(2*cos(2*x) - 1)*c
os(4*x) - cos(4*x)^2 - 4*cos(2*x)^2 - sin(4*x)^2 + 4*sin(4*x)*sin(2*x) - 4*sin(2*x)^2 + 4*cos(2*x) - 1)*log(co
s(x)^2 + sin(x)^2 + 2*cos(x) + 1) + (2*(2*cos(2*x) - 1)*cos(4*x) - cos(4*x)^2 - 4*cos(2*x)^2 - sin(4*x)^2 + 4*
sin(4*x)*sin(2*x) - 4*sin(2*x)^2 + 4*cos(2*x) - 1)*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) + 4*(sin(3*x) + sin
(x))*sin(4*x) - 8*sin(3*x)*sin(2*x) - 8*sin(2*x)*sin(x) + 4*cos(x))*sqrt(a)/(2*(2*cos(2*x) - 1)*cos(4*x) - cos
(4*x)^2 - 4*cos(2*x)^2 - sin(4*x)^2 + 4*sin(4*x)*sin(2*x) - 4*sin(2*x)^2 + 4*cos(2*x) - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.93 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=-\frac {a \arctan \left (\frac {\sqrt {a \tan \left (x\right )^{2} + a}}{\sqrt {-a}}\right )}{2 \, \sqrt {-a}} - \frac {\sqrt {a \tan \left (x\right )^{2} + a}}{2 \, \tan \left (x\right )^{2}} \]

[In]

integrate(cot(x)^3*(a+a*tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

-1/2*a*arctan(sqrt(a*tan(x)^2 + a)/sqrt(-a))/sqrt(-a) - 1/2*sqrt(a*tan(x)^2 + a)/tan(x)^2

Mupad [B] (verification not implemented)

Time = 11.15 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.82 \[ \int \cot ^3(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {a\,{\mathrm {tan}\left (x\right )}^2+a}}{\sqrt {a}}\right )}{2}-\frac {\sqrt {a\,{\mathrm {tan}\left (x\right )}^2+a}}{2\,{\mathrm {tan}\left (x\right )}^2} \]

[In]

int(cot(x)^3*(a + a*tan(x)^2)^(1/2),x)

[Out]

(a^(1/2)*atanh((a + a*tan(x)^2)^(1/2)/a^(1/2)))/2 - (a + a*tan(x)^2)^(1/2)/(2*tan(x)^2)